<template>
	<view class="pre-order">
		<!-- <uni-search-bar @confirm="1" @input="1" /> -->
		<!-- <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus" @input="input"
						@cancel="cancel" @clear="clear">
		</uni-search-bar> -->
		<uni-search-bar @confirm="confirm" @input="input"></uni-search-bar>
		<view class="list">
			<OrderItem v-for="item in homeHhelperList" :key="item.id" :item="item"></OrderItem>
		</view>
	</view>
</template>

<script>
	import { GetHomeHelperList,GetPreOrderListByKeywords } from '../../api/index.js'
	export default {
		data() {
			return {
				// searchValue:'2'
				homeHhelperList:[]
				
			};
		},
		onLoad() {
			this.getHomeHelperList()
		},
		methods:{
			async getHomeHelperList(){
				const { data:res } = await GetHomeHelperList()
				console.log(res)
				res.data.forEach(item=>{
					item.disc = item.disc.split('，')
				})
				console.log(res.data,'rrr')
				this.homeHhelperList = res.data
			},
			async confirm(v){
				console.log(v,'v')
				const { data:res } = await GetPreOrderListByKeywords(v.value)
				console.log(res,'2334rrr')
				res.data.forEach(item=>{
					item.disc = item.disc.split('，')
				})
				this.homeHhelperList = res.data
				if(!v){
					this.getHomeHelperList()
				}
			},
			input(v){
				console.log(v,'33')
			}
			
					
		}
	}
</script>

<style lang="scss">
.pre-order{
	width: 100%;
	// border: 1px solid #f00;
	// display: flex;
	padding: 20rpx;
	padding-top: 0;
	box-sizing: border-box;
	.list{
		width: 100%;
		// border: 1px solid #000;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		
		
	}
}
</style>
